package cn.edu.mju.cooprateflat.utils;

import cn.edu.mju.cooprateflat.FlatConfig;
import com.jfinal.plugin.activerecord.generator.Generator;
import com.jfinal.plugin.druid.DruidPlugin;

import javax.sql.DataSource;


public class CodeTools {
    public static void main(String[] args){
        String baseModelPackageName = "cn.edu.mju.cooprateflat.entity.base";
        String baseModelOutputDir = "D:\\视频制作\\项目\\协助平台\\SourceCode\\Backend\\src\\main\\java\\cn\\edu\\mju\\cooprateflat\\entity\\cms\\base";
        String modelPackageName = "cn.edu.mju.cooprateflat.entity";
        String modelOutputDir = "D:\\视频制作\\项目\\协助平台\\SourceCode\\Backend\\src\\main\\java\\cn\\edu\\mju\\cooprateflat\\entity\\cms";
        DruidPlugin druidPlugin = FlatConfig.createDruidPlugin();
        druidPlugin.start();
        DataSource dataSource = druidPlugin.getDataSource();
        Generator generator = new Generator(dataSource,baseModelPackageName,baseModelOutputDir,
                modelPackageName,modelOutputDir);
        generator.generate();

    }
}
